#ifndef _IMU_H_
#define _IMU_H_
#include "stm32f4xx.h"
#include "structconfig.h"
#include "arm_math.h"
#include "math.h"
#include "filter.h"
#include "BMI088.h"
#include "HMC5883L.h"
#include "QMC5883L.h"
#include "AK8975.h"
#include "usart.h"
#include "ppm.h"
#include "led.h"
#include "control.h"
#include "delay.h"
#include "myMath.h"
#include "timer.h"
#include "offsets.h" 

#define G					  9.80665f		      // m/s^2	
#define RadtoDeg    57.295780f				//弧度到角度 (弧度 * 180/3.1415)  
#define DegtoRad    0.0174533f				//角度到弧度 (角度 * 3.1415/180)
                                       
#define Acc_Gain  	0.0008978256f				//加速度变成G  1/LSB  ( LSB = 65536/量程) 加速度计量程=量程*G
#define Gyro_Gr 	  0.0002663161f			//角速度变成弧度(3.1415/180 *(1 /LSB))
#define Gyro_Gain	  0.015258789f			  //角速度变成度         
#define Quad_Num 10                     //四元数最大存储深度

extern float  a_z,a_Z,v_z,a_x,a_X,v_x,a_y,a_Y,v_y,a_x_1,a_y_1,aax,aay,aaz,aaax,aaay,aaaz; 
extern float	kalman_yaw,init_yaw;

void IMU(void);
void AHRS_compute(float gx, float gy, float gz, float ax, float ay, float az);
static float invSqrt(float x) ;

#endif
